//
//  MyDocument.h
//  RollingInTasks
//
//  Created by Rua Haszard Morris on 16/01/10.
//  Copyright __MyCompanyName__ 2010 . All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface LimityArrayController : NSArrayController
{
int limit;
}

@property int limit;

@end


@interface MyDocument : NSPersistentDocument {

IBOutlet NSTabView* tabView;
IBOutlet NSTabViewItem* todoListTab;
IBOutlet NSTabViewItem* taskEditTab;
IBOutlet NSTabViewItem* categoryEditTab;

IBOutlet NSStepper* jobCountStepper;
IBOutlet NSTextField* jobCountLabel;

IBOutlet NSStepper* priorityStepper;
IBOutlet NSTextField* priorityLabel;

IBOutlet NSPopUpButton* regularityPopup;
//IBOutlet NSArrayController* todoListDataArrayController;
IBOutlet NSTableView* todoListTasksTableView;
IBOutlet LimityArrayController* todoListDataArrayController;

IBOutlet NSTableView* todoListCategoriesTableView;
IBOutlet NSTableColumn* categoryTitleColumn;
IBOutlet NSTableColumn* categoryTotalColumn;
IBOutlet NSArrayController* todoListCategoriesDataArrayController;

IBOutlet NSSearchField* taskSearch;
IBOutlet NSButton* completedTickBox;
IBOutlet NSArrayController* taskEditPaneTasksArrayController;

IBOutlet NSButton* showCompletedTickBox;

IBOutlet NSPredicate* tasksFilterPredicate;
}

@property(retain) NSPredicate* tasksFilterPredicate;

// todo list pane actions
-(IBAction)jobCountChanged:(id)sender;
-(IBAction)priorityChanged:(id)sender;
-(IBAction)listRegularityPopupSelectionChanged:(id)sender;
-(IBAction)taskCompletedClicked:(id)sender;
-(IBAction)taskRowDoubleClicked:(id)sender;
-(IBAction)refreshEverything:(id)sender;

// task edit pane actions
-(IBAction)showCompletedClicked:(id)sender;


-(int)calcTotalForCategory:(id)completedArray;

//-(NSArray*)groupTotalsSortDescriptor;

@end
